using System;
using System.Collections.Generic;

namespace needle.Services.astra.Collections
{
	/// <summary>
	/// Named <see cref="ValueKey{T}"/>.
	/// </summary>
	/// <typeparam name="T"><see cref="ValueKey{T}.Id"/> type.</typeparam>
	public abstract class NamedValueKey<T> : ValueKey<T>
	{
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <remarks>Calls <see cref="Validate"/>(<paramref name="id"/>).</remarks>
		/// <param name="id">See <see cref="Id"/>.</param>
		public NamedValueKey(T id) : base(id)
		{
		}

		/// <summary>
		/// Name of this value key.
		/// </summary>
		public abstract string Name
		{
			get;
		}

		/// <summary>
		/// Text.
		/// </summary>
		/// <returns><see cref="Name"/>.</returns>
		public override string ToString()
		{
			return this.Name;
		}
	}
}
